from coresales.models import Photo, Category
from django.forms.models import ModelForm

class PhotoForm(ModelForm):
    '''
    def __init__(self, *args, **kwargs):
            is_url = kwargs.pop('is_url')
            is_image = kwargs.pop('is_image')
            super(PhotoForm, self).__init__(*args, **kwargs)
            if is_url:
                del self.fields['urlImage']
                #self.exclude('video_link')
            if is_image:
                del self.fields['image']
               '''
    class Meta:
        model = Photo

from django import forms

REASON_CHOICES = (
       (1, ("Consulta de articulos")),
       (2, ("Consulta de precios")), 
       (3, ("Otro")),
   )
class SearchForm(forms.Form):
    keyValue = forms.CharField(required=True,max_length=20,
                               label=(u'palabra clave'))
    category=forms.ModelChoiceField(queryset=Category.objects.all(),
                                    widget=forms.Select(attrs={'class':'ddl'}),
                                    label=(u'Categoria'))
